Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add core nft view #103

Merged
merged 1 commit into from
Jul 8, 2022
Merged

Add core nft view #103

merged 1 commit into from
Jul 8, 2022

Conversation

bshahid331
Copy link
Contributor

@bshahid331 bshahid331 commented Jun 28, 2022

See Issue: #98

Implementing the core NFT View which consists of common views that NFTs should implement to have basic interoperability throughout the ecosystem.

@bshahid331 bshahid331 marked this pull request as ready for review June 28, 2022 18:52
@bshahid331 bshahid331 requested a review from joshuahannan as a code owner June 28, 2022 18:52
/// NFTView is a group of views used to give a complete picture of an NFT
///
pub struct NFTView {
pub let id: UInt64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might also want uuid in here

Copy link
Member

@joshuahannan joshuahannan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put a short test in here for this?

@bshahid331
Copy link
Contributor Author

Can you put a short test in here for this?

Done

import ExampleNFT from "../../contracts/ExampleNFT.cdc"
import MetadataViews from "../../contracts/MetadataViews.cdc"

pub struct NFTView {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is is necessary to define a new NFTView in here? Can't we just return the one from the view?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't return some of the views, specifically CollectionData which contains a function type. Cadence throws an error if you try to return a function type from a script(i believe there is an issue to fix this but in the current state it would throw an error)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, that makes sense

@joshuahannan joshuahannan merged commit 4a62e70 into onflow:master Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants